<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>form 从后台获取数据</title>
    <link rel="stylesheet" type="text/css" href="/easyui.css">
    <link rel="stylesheet" type="text/css" href="/icon.css">
    <link rel="stylesheet" type="text/css" href="/demo.css">
    <script src="/jquery.min.js"></script>
    <script src="/jquery.easyui.min.js"></script>
</head>
<body>
<ul id="ul"></ul>
<a href="#" class="easyui-linkbutton" onclick="getSelected()">获取属性值</a>
<script type="text/javascript">
    $("#ul").tree({
        url:"/day12/showTree"
    });
    function getSelected() {
        var node = $('#ul').tree('getSelected');
        if(node){
            var s = node.text;
            console.log(s);
            console.log(node.attributes[0]);
            console.log(node.attributes[0].p1);
            if(node.attributes){
                s += ","+node.attributes[0].p1+","+node.attributes[0].p2;
            }
            alert(s);
        }
    }
</script>
</body>
</html>